#!/usr/bin/env python
# coding=utf-8

#__author__:  Administrator
#__date__:  2017/8/24

def sortlist(arg,flag):
    if flag == 1:
        print('[+]raise sort')
        for i in range(len(arg)):
            for j in range(len(arg)):
                if arg[i]<arg[j]:
                    arg[i],arg[j] = arg[j],arg[i]
    if flag == 0:
        print('[-]fall sort')
        for i in range(len(arg)):
            for j in range(len(arg)):
                if arg[i]>arg[j]:
                    arg[i],arg[j] = arg[j],arg[i]
    return arg
a = [1,24,5434,5,345,35,5,454,3,5]

print(sortlist(a,1))
print(sortlist(a,0))

